1. Field
The following description relates to a method and apparatus of encoding and decoding a quantized frequency spectrum coefficient based on a context.
2. Description of the Related Art
An audio signal is generally encoded and decoded in a frequency domain. Advance audio coding (AAC) may be used as a representative example. An AAC codec may be used as an example. The AAC codec may perform a modified discrete cosine transform (MDCT) for converting a time domain into the frequency domain, and may perform a frequency spectrum quantization using a masking degree of a signal from a psychoacoustic viewpoint. To further compress a performed quantization result, a lossless compression scheme may be applied. The ACC may use a Huffman coding scheme as the lossless compression scheme. A bit-sliced arithmetic coding (BSAC) codec to which an arithmetic coding scheme is applied instead of the Huffman coding scheme as the lossless compression scheme may be used.
When an object of lossless encoding is further examined, a quantized value of a quantized spectrum coefficient may be considered as a symbol, and the lossless encoding may be performed with respect to the symbol. An encoding may be performed by mapping a value of the quantized spectrum coefficient on a bitplane to pack bits. In the case of performing lossless encoding based on a context, the lossless encoding may be performed based on information of a previous frame. Accordingly, there is a desire for effectively performing the lossless encoding.